<template>
  <div v-if="question1.visible">
    <h3>{{ question1.text }}</h3>
    <!-- 遍历 question.options 数组 -->
    <div v-for="(option, index) in question1.options" :key="index">
      <label>{{ option.prefixText }}</label>
      <a-input
          disabled
          v-model:value="answer1['answer'][index]['answer']"
          placeholder="请输入答案"
          style="width: 300px;"
      />
    </div>
  </div>
</template>

<script setup>
import { defineProps} from 'vue';
import {useQuestions} from "@/utils/paper.js";
const { getQuestionById,getAnswerById} = useQuestions()
// 使用 defineProps 接收父组件传递的属性
const props = defineProps({
  questionId:{
    type:String
  }
});

const questionId=props.questionId;
const question1=getQuestionById(questionId);
const answer1=getAnswerById(questionId);

</script>

<style scoped>
</style>